﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="YieldPatternContext.cs" company="JDML Consulting Ltd.">
//   Copyright 2011 Photon Project - http://photon.codeplex.com
// </copyright>
// <summary>
//   Defines the YieldPatternContext type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Photon.Threading
{
    using System;

    public class YieldPatternContext : ITaskResult
    {
        public bool IsParallel
        {
            get;
            set;
        }

        public Exception Error
        {
            get;
            set;
        }

        public bool IsCanceled
        {
            get;
            set;
        }

        public object AsyncState
        {
            get;
            set;
        }
    }

    public class YieldPatternContext<T> : YieldPatternContext, ITaskResult<T>
    {
        public T Result
        {
            get;
            set;
        }
    }
}
